package com.wc.alorithm_blue_bridge._数学知识.约数.互质;

/**
 * @Author congge
 * @Date 2024/5/22 12:30
 * @description https://www.lanqiao.cn/problems/2360/learning/?problem_list_id=33&page=1
 */
public class Main {
    static int N = 2020;

    public static void main(String[] args) {
        int a = 1018;
        int res = 0;
        for (int b = 1; b <= N; b++) {
            if (gcd(a, b) == 1) res++;
        }
        System.out.println(res);
    }

    static int gcd(int a, int b) {
        return b > 0 ? gcd(b, a % b) : a;
    }
}

